var JingShang = new Vue({

    el : '#JingshangDetail',
    data :{
        renyuanId : $("#renyuanid").val(),
        jingshang : {},
        renyuan : {},
        jingshanglist : [],
        youchangzhongjielist:[],
        jingshangbanqiyelist:[],

        show : false,					// 显示列表是否有数据


    },
    created : function() {
        this.findDetail();

    },
    methods : {

        findDetail: function(){
            var _this = this;
            $.post("../jingshangqingkuang/find_lingdao_all_jingshang",{
                renyuanid : _this.renyuanId,
                rdm : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if (ppData != null){
                    if(ppData.result == "1"){
                        var data=ppData.resultContent;
                        if(data!=null){

                            _this.renyuan=data.renyuanlist[0];
                            _this.jingshangbanqiyelist=data.jingshangbanqiyelist;
                            _this.youchangzhongjielist=data.youchangzhongjielist;

                            var mmTruename = _this.renyuan.truename;
                            var mmBuzhibie = _this.renyuan.buzhibie;
                            var mmRenyuanleibie = _this.renyuan.renyuanleibietext;
                            var mmChusheng = _this.renyuan.chusheng;
                            var mmJunxianshijian = "";
                            var mmJunxian = _this.renyuan.junxianleibietext+_this.renyuan.junxiandengjitext;
                            if (_this.renyuan.junxianshijian!=null){
                                mmJunxianshijian = _this.renyuan.junxianshijian;
                            }

                            var mmZhiwucengji = _this.renyuan.zhiwucengjitext;
                            var mmZhiwushijian = "";
                            if (_this.renyuan.zhiwushijian!=null){
                                mmZhiwushijian= _this.renyuan.zhiwushijian;
                            }
                            var mmShifoujingshang = _this.renyuan.shifoujingshang;
                            if (mmShifoujingshang==1){
                                mmShifoujingshang="<div style=\"float: left;margin-right: 20px;\"><input type=\"checkbox\"style=\"margin-right: 5px;cursor: not-allowed;\"  onclick=\"return false\" checked=\"checked\"/>存在</div>"
                                    +"<div style=\"float: left;margin-right: 20px;\"><input type=\"checkbox\"style=\"margin-right: 5px;cursor: not-allowed;\"  onclick=\"return false\" />不存在</div>";
                            }else{
                                mmShifoujingshang="<div style=\"float: left;margin-right: 20px;\"><input type=\"checkbox\"style=\"margin-right: 5px;cursor: not-allowed;\"  onclick=\"return false\" />存在</div>"
                                    +"<div style=\"float: left;margin-right: 20px;\"><input type=\"checkbox\"style=\"margin-right: 5px;cursor: not-allowed;\"  onclick=\"return false\" checked=\"checked\"/>不存在</div>";
                            }

                            var mmHtml = "<table class=\"table table-bordered\">\n" +
                                "                    <tr>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 100px;\" rowspan=\"2\" colspan=\"2\">干部姓名</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 120px;\" rowspan=\"2\" colspan=\"2\">"+mmTruename+"</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 150px;\" colspan=\"2\">部职别</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 300px;\" colspan=\"3\">"+mmBuzhibie+"</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 150px;\"colspan=\"2\">人员类别</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;\" colspan=\"4\">"+mmRenyuanleibie+"</td>\n" +
                                "                    </tr>\n" +
                                "                    <tr>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 150px;\"colspan=\"2\">出生年月</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 150px;\" colspan=\"2\">"+mmChusheng+"</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 150px;\">军衔等级及时间</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 150px;\" colspan=\"2\">\n" +
                                "                            <div>"+mmJunxian+"</div>\n" +
                                "                            <div>"+mmJunxianshijian+"</div>\n" +
                                "                        </td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 190px;\"colspan=\"2\">职务层级（等级）及时间</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 190px;\" colspan=\"2\">\n" +
                                "                            <div>"+mmZhiwucengji+"</div>\n" +
                                "                            <div>"+mmZhiwushijian+"</div>\n" +
                                "                        </td>\n" +
                                "                    </tr>\n" +
                                "                    <tr>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;\" colspan=\"7\">配偶、子女及其配偶是否存在经商办企业行为</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;\" colspan=\"8\"><div id=\"ispass\" style=\"width: 200px;margin: 0 auto;\">\n" +mmShifoujingshang +
                                "                        </div></td>\n" +
                                "                    </tr>\n" +
                                "                    <tr>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 40px;\" rowspan=\"2\">序号</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 60px;\" rowspan=\"2\">配偶、子女及其配偶的姓名</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 60px;\" rowspan=\"2\">与干部关系</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 100px;\" rowspan=\"2\">身份证号码</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 100px;\" rowspan=\"2\"  colspan=\"2\">企业名称</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 150px;\" rowspan=\"2\">经营范围</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 60px;\" rowspan=\"2\">经营状态</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 60px;\" rowspan=\"2\">认缴出资额（万元）</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 60px;\" rowspan=\"2\">在企业所任职务</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 120px;\" rowspan=\"2\">近三年排在前5名的销售商品或服务名称</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 120px;\" rowspan=\"2\">近三年排在前5名的交易对象名称</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 150px;\" colspan=\"2\">目前是否存在与军队单位有直接经济利益关系情况</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;\" rowspan=\"2\">近三年发生过直接经济利益关系的军队单位名称</td>\n" +
                                "                    </tr>\n" +
                                "                    <tr>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 40px;\" >是/否</td>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;width: 110px;\">军队单位名称</td>\n" +
                                "\n" +
                                "                    </tr>\n" +
                                "                    <tr>\n" +
                                "                        <td style=\"text-align:center;vertical-align:middle;\"  colspan=\"15\">一、经商办企业情况</td>\n" +
                                "                    </tr>"

                            for (var i = 0; i < _this.jingshangbanqiyelist.length; i++) {
                                var mmJingshang = _this.jingshangbanqiyelist[i];
                                var mmIndex = i+1;
                                var mmName = mmJingshang.name;
                                var mmGuanxi = mmJingshang.guanxitext;
                                var mmShenfenzhenghao = mmJingshang.shenfenzhenghao;

                                var mmHebinghang = "";
                                if (mmJingshang.hebing>1){
                                    mmHebinghang = "rowspan='"+mmJingshang.hebing+"'";
                                }



                                mmHtml+="<tr >\n" +
                                    "         <td style=\"text-align:center;vertical-align:middle;\""+mmHebinghang+">"+mmIndex+"</td>\n" +
                                    "         <td style=\"text-align:center;vertical-align:middle;\""+mmHebinghang+">"+mmName+"</td>\n" +
                                    "         <td style=\"text-align:center;vertical-align:middle;\" "+mmHebinghang+">"+mmGuanxi+"</td>\n" +
                                    "         <td style=\"text-align:center;vertical-align:middle;\" "+mmHebinghang+">"+mmShenfenzhenghao+"</td>"

                                if (mmJingshang.jingshangqingkuanglist.length==0){
                                    mmHtml += "<td colspan='10'></td></tr>";
                                }
                                for (var j = 0; j < mmJingshang.jingshangqingkuanglist.length; j++) {
                                    var mmJingshangqingkuang = mmJingshang.jingshangqingkuanglist[j];
                                    var mmQiyename = mmJingshangqingkuang.qiyename;
                                    var mmJingyingfanwei = mmJingshangqingkuang.jingyingfanwei==null?"":mmJingshangqingkuang.jingyingfanwei;

                                    var mmJingyingzhuangtaiText = mmJingshangqingkuang.jingyingzhuangtaitext==null?"":mmJingshangqingkuang.jingyingzhuangtaitext;

                                    var mmRenjiaochuzie = mmJingshangqingkuang.renjiaochuzie==null?"":mmJingshangqingkuang.renjiaochuzie;

                                    var mmZhiwu = mmJingshangqingkuang.zhiwutext==null?"":mmJingshangqingkuang.zhiwutext;

                                    var mmQianwushangpihuofuwuname = mmJingshangqingkuang.qianwushangpinhuofuwuname==null?"":mmJingshangqingkuang.qianwushangpinhuofuwuname;

                                    var mmQianwujiaoyiduixiangname = mmJingshangqingkuang.qianwujiaoyiduixiangname==null?"":mmJingshangqingkuang.qianwujiaoyiduixiangname;

                                    var mmShifouzhijieguanxi = mmJingshangqingkuang.shifouyouzhijieguanxi;
                                    if (mmShifouzhijieguanxi==1){
                                        mmShifouzhijieguanxi = "是"
                                    }else {
                                        mmShifouzhijieguanxi = "否"
                                    }

                                    var mmShijunduimingcheng = mmJingshangqingkuang.shijunduimingcheng==null?"":mmJingshangqingkuang.shijunduimingcheng;

                                    var mmJingsanzhijieguanximingcheng = mmJingshangqingkuang.jinsanzhijieguanximingcheng==null?"":mmJingshangqingkuang.jinsanzhijieguanximingcheng;


                                    var mmHuanhangfu = "";
                                    if (j!=0){
                                        mmHuanhangfu = "<tr>";
                                    }
                                    mmHtml+= mmHuanhangfu+"<td style=\"text-align:center;vertical-align:middle;width: 100px;\"  colspan=\"2\">"+mmQiyename+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 150px;\">"+mmJingyingfanwei+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 60px;\">"+mmJingyingzhuangtaiText+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 60px;\">"+mmRenjiaochuzie+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 150px;\">"+mmZhiwu+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 120px;\">"+mmQianwushangpihuofuwuname+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 120px\">"+mmQianwujiaoyiduixiangname+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 40px;\">"+mmShifouzhijieguanxi+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 110px;\">"+mmShijunduimingcheng+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;\">"+mmJingsanzhijieguanximingcheng+"</td>\n" +
                                        "    </tr>"
                                }



                            }

                            mmHtml+="<tr>\<td style=\"text-align:center;vertical-align:middle;\"  colspan=\"15\">二、从事有偿社会中介和法律服务情况</td></tr>"

                            for (var k = 0; k < _this.youchangzhongjielist.length; k++) {
                                var mmJingshang = _this.youchangzhongjielist[k];
                                var mmIndex = k+1;
                                var mmName = mmJingshang.name;
                                var mmGuanxi = mmJingshang.guanxitext;
                                var mmShenfenzhenghao = mmJingshang.shenfenzhenghao;

                                var mmHebinghang = "";
                                if (mmJingshang.hebing>1){
                                    mmHebinghang = "rowspan='"+mmJingshang.hebing+"'";
                                }



                                mmHtml+="<tr >\n" +
                                    "         <td style=\"text-align:center;vertical-align:middle;\""+mmHebinghang+">"+mmIndex+"</td>\n" +
                                    "         <td style=\"text-align:center;vertical-align:middle;\""+mmHebinghang+">"+mmName+"</td>\n" +
                                    "         <td style=\"text-align:center;vertical-align:middle;\" "+mmHebinghang+">"+mmGuanxi+"</td>\n" +
                                    "         <td style=\"text-align:center;vertical-align:middle;\" "+mmHebinghang+">"+mmShenfenzhenghao+"</td>"

                                if (mmJingshang.jingshangqingkuanglist.length==0){
                                    mmHtml += "<td colspan='10'></td></tr>";
                                }
                                for (var l = 0; l < mmJingshang.jingshangqingkuanglist.length; l++) {
                                    var mmJingshangqingkuang = mmJingshang.jingshangqingkuanglist[l];
                                    var mmQiyename = mmJingshangqingkuang.qiyename;
                                    var mmJingyingfanwei = mmJingshangqingkuang.jingyingfanwei==null?"":mmJingshangqingkuang.jingyingfanwei;

                                    var mmJingyingzhuangtaiText = mmJingshangqingkuang.jingyingzhuangtaitext==null?"":mmJingshangqingkuang.jingyingzhuangtaitext;

                                    var mmRenjiaochuzie = mmJingshangqingkuang.renjiaochuzie==null?"":mmJingshangqingkuang.renjiaochuzie;

                                    var mmZhiwu = mmJingshangqingkuang.zhiwutext==null?"":mmJingshangqingkuang.zhiwutext;

                                    var mmQianwushangpihuofuwuname = mmJingshangqingkuang.qianwushangpinhuofuwuname==null?"":mmJingshangqingkuang.qianwushangpinhuofuwuname;

                                    var mmQianwujiaoyiduixiangname = mmJingshangqingkuang.qianwujiaoyiduixiangname==null?"":mmJingshangqingkuang.qianwujiaoyiduixiangname;

                                    var mmShifouzhijieguanxi = mmJingshangqingkuang.shifouyouzhijieguanxi;
                                    if (mmShifouzhijieguanxi==1){
                                        mmShifouzhijieguanxi = "是"
                                    }else {
                                        mmShifouzhijieguanxi = "否"
                                    }

                                    var mmShijunduimingcheng = mmJingshangqingkuang.shijunduimingcheng==null?"":mmJingshangqingkuang.shijunduimingcheng;

                                    var mmJingsanzhijieguanximingcheng = mmJingshangqingkuang.jinsanzhijieguanximingcheng==null?"":mmJingshangqingkuang.jinsanzhijieguanximingcheng;

                                    var mmHuanhangfu = "";
                                    if (l!=0){
                                        mmHuanhangfu = "<tr>";
                                    }
                                    mmHtml+= mmHuanhangfu+"<td style=\"text-align:center;vertical-align:middle;width: 100px;\"  colspan=\"2\">"+mmQiyename+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 150px;\">"+mmJingyingfanwei+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 60px;\">"+mmJingyingzhuangtaiText+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 60px;\">"+mmRenjiaochuzie+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 150px;\">"+mmZhiwu+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 120px;\">"+mmQianwushangpihuofuwuname+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 120px\">"+mmQianwujiaoyiduixiangname+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 40px;\">"+mmShifouzhijieguanxi+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;width: 110px;\">"+mmShijunduimingcheng+"</td>\n" +
                                        "         <td style=\"text-align:center;vertical-align:middle;\">"+mmJingsanzhijieguanximingcheng+"</td>\n" +
                                        "    </tr>"
                                }



                            }
                            mmHtml+="</table>";
                            $("#List").html(mmHtml);
                        }

                    }

                }else{
                    layer.alert(ppData.message);
                }

            },"json");
        },



        toclose: function(){
            xadmin.close();
        },


    },
    watch :{

    }

});
